<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="OpenLS.Spreadsheet.UI.WorksheetDrawingResources"
        xmlns:drawings="http://schemas.Kherty.com/office/2007/spreadsheet"
        xmlns:shapes="http://schemas.Kherty.com/office/2007/drawing"
        xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
        xmlns:drawing="http://schemas.Kherty.com/office/2007/drawing"
        xmlns:drawingui="http://schemas.Kherty.com/office/2007/drawing" 
                    xmlns:wsui="clr-namespace:OpenLS.Spreadsheet.UI"
                    xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.Internals;assembly=OpenLS.Spreadsheet" xmlns:Internals1="clr-namespace:OpenLS.Spreadsheet.UI.Internals">
  <ResourceDictionary.MergedDictionaries>
        <drawingui:DrawingResources/>
  </ResourceDictionary.MergedDictionaries>
    
  <Style x:Key="resizableControl" TargetType="{x:Type FrameworkElement}">
    <Setter Property="Focusable" Value="True"/>
        <EventSetter Event="PreviewMouseRightButtonDown" Handler = "OnResizablePreviewRightButtonDown"/>
        <EventSetter Event="GotFocus" Handler = "OnResizableGotFocus"/>
        <EventSetter Event="LostFocus" Handler = "OnResizableLostFocus"/>
    <EventSetter Event="PreviewKeyDown" Handler="OnObjectKeyDown"/>
    <EventSetter Event="MouseDown" Handler="OnObjectMouseDown"/>
  </Style>
    
    <DataTemplate DataType="{x:Type drawings:XamlElement}">
        <!--<ContentControl Content="{Binding Content, Mode=OneTime}" /> -->
        <ContentControl>
            <ContentControl.Content>
                <MultiBinding>
                    <MultiBinding.Converter>
                        <Internals1:XamlElementContentAccessor></Internals1:XamlElementContentAccessor>
                    </MultiBinding.Converter>
                    <Binding></Binding>
                    <Binding RelativeSource="{RelativeSource Self}"></Binding>
                    <Binding RelativeSource="{RelativeSource Self}" Path="(drawings:SpreadsheetElement.WorksheetFragment)"></Binding>
                </MultiBinding>
            </ContentControl.Content>
        </ContentControl>
    </DataTemplate>
    
  <DataTemplate DataType="{x:Type drawings:Drawing}">
    <ItemsControl ItemsSource="{Binding Items}" Focusable="True"/>
  </DataTemplate>
    
  <DataTemplate DataType="{x:Type drawings:OneCellAnchor}" >
    <ContentControl Content="{Binding Content}" Focusable="True" />
  </DataTemplate>
    
  <DataTemplate DataType="{x:Type drawings:TwoCellAnchor}">
    <ContentControl Content="{Binding Content}" Focusable="True"/>
  </DataTemplate>
    
  <DataTemplate DataType="{x:Type drawings:AbsoluteAnchor}">
    <ContentControl Content="{Binding Content}" Focusable="True" />
  </DataTemplate>
    
  <DataTemplate DataType="{x:Type chart:GraphicFrame}">
      <ContentPresenter Content="{Binding Path=Graphic.ChartSpace}" Tag="chart"/>
  </DataTemplate>
    
  <DataTemplate DataType="{x:Type shapes:Picture}">
    <Image Stretch="{Binding Stretch}"
          Width="{Binding Path=Width}" Height="{Binding Path=Height}" Source ="{Binding Source}"/> <!-- BitmapEffect ={Binding BitmapEffect}-->
  </DataTemplate>

</ResourceDictionary>